// The Vue build version to load with the `import` command
// (runtime-only or standalone) has been set in webpack.base.conf with an alias.
import Vue from 'vue';
import App from './App';
import router from './route';
import store from './vuex';
import i18n from './lang';
import Api from './api';
import Vant from 'vant';
import 'vant/lib/index.css';
import './assets/css/mb-style.css';
import './assets/css/pc-style.css';
import './assets/css/clipper.css';
import Common from './assets/js/utils';
import Clipper from './assets/js/clipper';
import VueCookies from 'vue-cookies';
import Raven from 'raven-js';
import RavenVue from 'raven-js/plugins/vue';
window.$Raven = Raven;

Raven
  .config('https://8e5688c6f82a42bfbaf6f368dab8c5a3@sentry.io/1360119', {release: 'witmice@1.0.1'})
  .addPlugin(RavenVue, Vue)
  .install();
Vue.config.errorHandler = function(err, vm, info) {
  Raven.captureException(err);
};
// if (process.env.NODE_ENV !== 'development') {
//
// }
Vue.use(VueCookies);
// import axios from 'axios';
// import './mock/mock.js';
Vue.use(Clipper);
Vue.use(Vant);
Vue.use(Common);
Vue.prototype.$http = Api;
Vue.config.productionTip = false;
router.beforeEach((to, from, next) => {
  /* 路由发生变化修改页面title */
  if (to.meta.title) {
    document.title = to.meta.title;
  }
  next();
});
/* eslint-disable no-new */
new Vue({
  el: '#app',
  router,
  store,
  i18n,
  components: {
    App
  },
  template: '<App/>'
});
